import React from 'react'

class SysRoleTools extends React.Component {
  constructor(props){
    super(props)
  }

  onSearchClick(){
    var name = $(this.refs.name).val();

    var data = {
      name:name
    }

    this.props.onDataSearch(data);
  }

  render(){
    return (
      <div className="sys-role-tools row">
        <div className="col-sm-4 f-dn">
          <div className="input-group">
            <input ref="name" id="name" type="text" className="form-control" placeholder="Search for..." />
            <span className="input-group-btn">
              <button className="btn btn-default" type="button" onClick={(event)=>this.onSearchClick()}>查詢</button>
            </span>
          </div>
        </div>
        <div className="col-sm-2 col-lg-2 col-sm-offset-10 col-lg-offset-10  create-button">
          <button type="button" className="btn-create"
                  onClick={(event)=>this.props.onCreateClick()}>添加</button>
        </div>

      </div>
    )
  }
}

export default SysRoleTools
